home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / Cpp4VB / WINTLB / WINMSG.ODL < prev    next >
Text File  |  1996-02-27  |  32KB  |  1,002 lines

  1.  
  2. [
  3. uuid(5467404C-3A82-101B-8181-00AA003743D3),
  4. helpstring("Windows Messages"),
  5. #ifdef WIN32
  6. dllname("USER32.DLL")
  7. #else
  8. dllname("USER.EXE")
  9. #endif
  10. ]
  11. module WinMessage {
  12.  
  13.     [
  14.     #ifdef WIN32
  15.     usesgetlasterror,
  16.     entry("SendMessageA"),
  17.     #else
  18.     entry("SendMessage"),
  19.     #endif
  20.     helpstring("Sends a Windows message (LPARAM as Long)")
  21.     ]
  22.     LRESULT WINAPI SendMessageAsLong([in] HWND hwnd, [in] UINT uMsg,
  23.                                      [in] WPARAM wParam,
  24.                                      [in] LONG lParam);
  25.  
  26. //@B SendMessages
  27.     [
  28.     #ifdef WIN32
  29.     usesgetlasterror,
  30.     entry("SendMessageA"),
  31.     #else
  32.     entry("SendMessage"),
  33.     #endif
  34.     helpstring("Sends a Windows message (LPARAM as String)")
  35.     ]
  36.     LRESULT WINAPI SendMessageAsStr([in] HWND hwnd, [in] UINT uMsg,
  37.                                     [in] WPARAM wParam,
  38.                                     [in, out] LPSTR lParam);
  39.  
  40.     [
  41.     #ifdef WIN32
  42.     usesgetlasterror,
  43.     entry("SendMessageA"),
  44.     #else
  45.     entry("SendMessage"),
  46.     #endif
  47.     helpstring("Sends a Windows message (LPARAM as Long pointer)")
  48.     ]
  49.     LRESULT WINAPI SendMessageAsLp([in] HWND hwnd, [in] UINT uMsg,
  50.                                    [in] WPARAM wParam,
  51.                                    [in] LONG lParam);
  52.  
  53.     [
  54.     #ifdef WIN32
  55.     usesgetlasterror,
  56.     entry("SendMessageA"),
  57.     #else
  58.     entry("SendMessage"),
  59.     #endif
  60.     helpstring("Sends a Windows message (LPARAM as ByRef Long or Long array)")
  61.     ]
  62.     LRESULT WINAPI SendMessageForLong([in] HWND hwnd, [in] UINT uMsg,
  63.                                       [in] WPARAM wParam,
  64.                                       [in, out] LONG * lParam);
  65. //@E SendMessages
  66.  
  67.     [
  68.     #ifdef WIN32
  69.     usesgetlasterror,
  70.     entry("SendMessageA"),
  71.     helpstring("Sends a Windows message (LPARAM as ByRef SysInt (Long) or array of SysInts)")
  72.     #else
  73.     entry("SendMessage"),
  74.     helpstring("Sends a Windows message (LPARAM as ByRef SysInt (Integer) or array of SysInts)")
  75.     #endif
  76.     ]
  77.     LRESULT WINAPI SendMessageForInt([in] HWND hwnd, [in] UINT uMsg,
  78.                                      [in] WPARAM wParam,
  79.                                      [in, out] UINT * lParam);
  80.  
  81.     [
  82.     #ifdef WIN32
  83.     usesgetlasterror,
  84.     entry("SendMessageA"),
  85.     #else
  86.     entry("SendMessage"),
  87.     #endif
  88.     helpstring("Sends a Windows message (LPARAM as ByRef Byte or array of Bytes)")
  89.     ]
  90.     LRESULT WINAPI SendMessageForByte([in] HWND hwnd,
  91.                                       [in] UINT uMsg,
  92.                                       [in] WPARAM wParam,
  93.                                       [in, out] BYTE * lParam);
  94.  
  95.  
  96.     [
  97.     #ifdef WIN32
  98.     usesgetlasterror,
  99.     entry("PostMessageA"),
  100.     #else
  101.     entry("PostMessage"),
  102.     #endif
  103.     helpstring("Posts message to Windows queue (LPARAM as Long)")
  104.     ]
  105.     BOOL    WINAPI PostMessageAsLong([in] HWND hwnd, [in] UINT uMsg,
  106.                                      [in] WPARAM wParam,
  107.                                      [in] LONG lParam);
  108.  
  109.     [
  110.     #ifdef WIN32
  111.     usesgetlasterror,
  112.     entry("PostMessageA"),
  113.     #else
  114.     entry("PostMessage"),
  115.     #endif
  116.     helpstring("Posts message to Windows queue (LPARAM as String)")
  117.     ]
  118.     BOOL    WINAPI PostMessageAsStr([in] HWND hwnd, [in] UINT uMsg,
  119.                                     [in] WPARAM wParam,
  120.                                     [in, out] LPSTR lParam);
  121.  
  122.     [
  123.     #ifdef WIN32
  124.     usesgetlasterror,
  125.     entry("PostMessageA"),
  126.     #else
  127.     entry("PostMessage"),
  128.     #endif
  129.     helpstring("Posts message to Windows queue (LPARAM as Long pointer)")
  130.     ]
  131.     BOOL    WINAPI PostMessageAsLp([in] HWND hwnd, [in] UINT uMsg,
  132.                                    [in] WPARAM wParam,
  133.                                    [in] LONG lParam);
  134.  
  135.     [
  136.     #ifdef WIN32
  137.     usesgetlasterror,
  138.     entry("PostMessageA"),
  139.     #else
  140.     entry("PostMessage"),
  141.     #endif
  142.     helpstring("Posts message to Windows queue (LPARAM as ByRef Long or Long array)")
  143.     ]
  144.     BOOL    WINAPI PostMessageForLong([in] HWND hwnd, [in] UINT uMsg,
  145.                                       [in] WPARAM wParam,
  146.                                       [in, out] LONG * lParam);
  147.  
  148.     [
  149.     #ifdef WIN32
  150.     usesgetlasterror,
  151.     entry("PostMessageA"),
  152.     helpstring("Posts message to Windows queue (LPARAM as ByRef SysInt (Long) or array of SysInts)")
  153.     #else
  154.     entry("PostMessage"),
  155.     helpstring("Posts message to Windows queue (LPARAM as ByRef SysInt (Integer) or array of SysInts)")
  156.     #endif
  157.     ]
  158.     BOOL    WINAPI PostMessageForInt([in] HWND hwnd, [in] UINT uMsg,
  159.                                      [in] WPARAM wParam,
  160.                                      [in, out] UINT * lParam);
  161.  
  162.     [
  163.     #ifdef WIN32
  164.     usesgetlasterror,
  165.     entry("PostMessageA"),
  166.     #else
  167.     entry("PostMessage"),
  168.     #endif
  169.     helpstring("Posts message to Windows queue (LPARAM as ByRef Byte or array of Bytes)")
  170.     ]
  171.     BOOL    WINAPI PostMessageForByte([in] HWND hwnd,
  172.                                       [in] UINT uMsg,
  173.                                       [in] WPARAM wParam,
  174.                                       [in, out] BYTE * lParam);
  175.  
  176.     /*
  177.     BOOL    WINAPI PostAppMessage(HTASK, UINT, WPARAM, LPARAM);
  178.  
  179.     void    WINAPI PostQuitMessage(int);
  180.     */
  181.  
  182.     [
  183.     usesgetlasterror,
  184.     entry("RegisterWindowMessageA"),
  185.     helpstring("Defines window message guaranteed to be unique"),
  186.     ]
  187.     UINT WINAPI RegisterWindowMessage([in] LPSTR lpsz);
  188.  
  189.     /*
  190.     // Queued message structure
  191.     typedef struct tagMSG
  192.     {
  193.         HWND    hwnd;
  194.         UINT        message;
  195.         WPARAM  wParam;
  196.         LPARAM  lParam;
  197.         DWORD       time;
  198.         POINT   pt;
  199.     } MSG;
  200.     typedef MSG* PMSG;
  201.     typedef MSG NEAR* NPMSG;
  202.     typedef MSG FAR* LPMSG;
  203.  
  204.     BOOL    WINAPI GetMessage(MSG FAR*, [in] HWND hwnd, UINT, UINT);
  205.     BOOL    WINAPI PeekMessage(MSG FAR*, [in] HWND hwnd, UINT, UINT, UINT);
  206.  
  207.     void    WINAPI WaitMessage(void);
  208.  
  209.     DWORD   WINAPI GetMessagePos(void);
  210.     LONG    WINAPI GetMessageTime(void);
  211.     LPARAM  WINAPI GetMessageExtraInfo(void);
  212.  
  213.     BOOL    WINAPI TranslateMessage(const MSG FAR*);
  214.     LONG    WINAPI DispatchMessage(const MSG FAR*);
  215.  
  216.     BOOL    WINAPI SetMessageQueue(int);
  217.  
  218.     BOOL    WINAPI GetInputState(void);
  219.  
  220.     DWORD   WINAPI GetQueueStatus(UINT flags);
  221.     */
  222.  
  223.     /*
  224.     void    WINAPI ReplyMessage(LRESULT);
  225.     BOOL    WINAPI InSendMessage(void);
  226.  
  227.     // Special HWND value for use with PostMessage() and SendMessage()
  228.  
  229.     BOOL WINAPI CallMsgFilter(MSG FAR*, int);
  230.     */
  231.  
  232.     /*
  233.     // PeekMessage() options
  234.     const int PM_NOREMOVE     = 0x0000;
  235.     const int PM_REMOVE       = 0x0001;
  236.     const int PM_NOYIELD      = 0x0002;
  237.  
  238.     // GetQueueStatus flags
  239.     const int QS_KEY          = 0x0001;
  240.     const int QS_MOUSEMOVE    = 0x0002;
  241.     const int QS_MOUSEBUTTON  = 0x0004;
  242.     const int QS_MOUSE        = 0x0006; // (QS_MOUSEMOVE | QS_MOUSEBUTTON)
  243.     const int QS_POSTMESSAGE  = 0x0008;
  244.     const int QS_TIMER        = 0x0010;
  245.     const int QS_PAINT        = 0x0020;
  246.     const int QS_SENDMESSAGE  = 0x0040;
  247.  
  248.     const int QS_ALLINPUT  = 0x007f;
  249.     */
  250.  
  251.     const int HWND_BROADCAST  =-1;
  252.  
  253.     const int WM_NULL          = 0x0000;
  254.  
  255.     const int WM_WININICHANGE  =       0x001A;
  256.  
  257.     const int WM_SYSCOLORCHANGE =   0x0015;
  258.  
  259.     // Palette window messages
  260.     const int WM_QUERYNEWPALETE = 0x030F;
  261.     const int WM_PALETTEISCHANGING = 0x0310;
  262.     const int WM_PALETTECHANGED    = 0x0311;
  263.  
  264.     // Spooler status notification message
  265.     const int WM_SPOOLERSTATUS =       0x002A;
  266.  
  267.     const int WM_DEVMODECHANGE =    0x001B;
  268.     const int WM_TIMECHANGE    = 0x001E;
  269.  
  270.     const int WM_SHOWWINDOW    = 0x0018;
  271.  
  272.     // WM_SHOWWINDOW wParam codes
  273.     const int SW_PARENTCLOSING =    1;
  274.     const int SW_OTHERMAXIMIZED=    2;
  275.     const int SW_PARENTOPENING =    3;
  276.     const int SW_OTHERRESTORED =    4;
  277.  
  278.     /* Obsolete constant names
  279.     const int SW_OTHERZOOM     =    SW_OTHERMAXIMIZED;
  280.     const int SW_OTHERUNZOOM   =       SW_OTHERRESTORED;
  281.     */
  282.  
  283.     // Dialog messages
  284.     const int DM_GETDEFID      = WM_USER+0;
  285.     const int DM_SETDEFID      = WM_USER+1;
  286.  
  287.     // Returned in HIWORD() of DM_GETDEFID result if msg is supported
  288.     const int DC_HASDEFID      = 0x534B;
  289.  
  290.     // Static Control Mesages
  291.     #ifdef WIN32
  292.     const int STM_SETICON      = 0x0170;
  293.     const int STM_GETICON      = 0x0171;
  294.     #else
  295.     const int STM_SETICON      = WM_USER+0;
  296.     const int STM_GETICON      = WM_USER+1;
  297.     #endif
  298.  
  299.     // PenWindows specific messages
  300.     const int WM_PENWINFIRST   =       0x0380;
  301.     const int WM_PENWINLAST    = 0x038F;
  302.  
  303.     // Coalescing messages
  304.     const int WM_COALESCE_FIRST =   0x0390;
  305.     const int WM_COALESCE_LAST  =   0x039F;
  306.  
  307.     const int WM_POWER     = 0x0048;
  308.  
  309.     // wParam for WM_POWER window message and DRV_POWER driver notification
  310.     const int PWR_OK             =    1;
  311.     const int PWR_FAIL           =  -1;
  312.     const int PWR_SUSPENDREQUEST =  1;
  313.     const int PWR_SUSPENDRESUME  =  2;
  314.     const int PWR_CRITICALRESUME = 3;
  315.  
  316.     // ****** Application termination *******
  317.  
  318.     const int WM_QUERYENDSESSION  = 0x0011;
  319.     const int WM_ENDSESSION       = 0x0016;
  320.  
  321.     const int WM_QUIT             = 0x0012;
  322.  
  323.     const int WM_SYSTEMERROR   =           0x0017;
  324.  
  325.     const int WM_CREATE        = 0x0001;
  326.     const int WM_NCCREATE      = 0x0081;
  327.  
  328.     /* Omit WM_CREATE/WM_NCCREATE lParam struct
  329.     typedef struct tagCREATESTRUCT
  330.     {
  331.         void FAR* lpCreateParams;
  332.         HINSTANCE hInstance;
  333.         HMENU     hMenu;
  334.         HWND      hwndParent;
  335.         int       cy;
  336.         int       cx;
  337.         int       y;
  338.         int       x;
  339.         LONG      style;
  340.         LPCSTR    lpszName;
  341.         LPCSTR    lpszClass;
  342.         DWORD     dwExStyle;
  343.     } CREATESTRUCT;
  344.     typedef CREATESTRUCT FAR* LPCREATESTRUCT;
  345.     */
  346.  
  347.     const int WM_DESTROY       = 0x0002;
  348.     const int WM_NCDESTROY     = 0x0082;
  349.  
  350.     const int WM_SETTEXT       = 0x000C;
  351.     const int WM_GETTEXT       = 0x000D;
  352.     const int WM_GETTEXTLENGTH =    0x000E;
  353.  
  354.     const int WM_SETREDRAW     = 0x000B;
  355.  
  356.     const int WM_ENABLE            = 0x000A;
  357.  
  358.     const int WM_WINDOWPOSCHANGING = 0x0046;
  359.     const int WM_WINDOWPOSCHANGED  = 0x0047;
  360.  
  361.     /* Omit WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam
  362.     typedef struct tagWINDOWPOS
  363.     {
  364.         HWND    hwnd;
  365.         HWND    hwndInsertAfter;
  366.         int     x;
  367.         int     y;
  368.         int     cx;
  369.         int     cy;
  370.         UINT    flags;
  371.     } WINDOWPOS;
  372.     typedef WINDOWPOS FAR* LPWINDOWPOS;
  373.     */
  374.  
  375.     const int WM_MOVE          = 0x0003;
  376.     const int WM_SIZE          = 0x0005;
  377.  
  378.     // WM_SIZE message wParam values
  379.     const int SIZE_RESTORED    = 0;
  380.     const int SIZE_MINIMIZED   =       1;
  381.     const int SIZE_MAXIMIZED   =       2;
  382.     const int SIZE_MAXSHOW     = 3;
  383.     const int SIZE_MAXHIDE     = 4;
  384.  
  385.     const int WM_QUERYOPEN     = 0x0013;
  386.     const int WM_CLOSE     = 0x0010;
  387.  
  388.     /* Omit Struct pointed to by WM_GETMINMAXINFO lParam
  389.     typedef struct tagMINMAXINFO
  390.     {
  391.         POINT ptReserved;
  392.         POINT ptMaxSize;
  393.         POINT ptMaxPosition;
  394.         POINT ptMinTrackSize;
  395.         POINT ptMaxTrackSize;
  396.     } MINMAXINFO;
  397.     */
  398.     const int WM_GETMINMAXINFO =    0x0024;
  399.  
  400.     const int WM_PAINT          = 0x000F;
  401.     const int WM_ERASEBKGND    = 0x0014;
  402.     const int WM_ICONERASEBKGND =   0x0027;
  403.  
  404.  
  405.     // ****** Non-client window area management ********
  406.  
  407.     const int WM_NCPAINT       = 0x0085;
  408.  
  409.     const int WM_NCCALCSIZE    = 0x0083;
  410.  
  411.     // WM_NCCALCSIZE return flags
  412.     const int WVR_ALIGNTOP     = 0x0010;
  413.     const int WVR_ALIGNLEFT    = 0x0020;
  414.     const int WVR_ALIGNBOTTOM  =    0x0040;
  415.     const int WVR_ALIGNRIGHT   =       0x0080;
  416.     const int WVR_HREDRAW      = 0x0100;
  417.     const int WVR_VREDRAW      = 0x0200;
  418.     const int WVR_REDRAW       = 0x0300; // (WVR_HREDRAW | WVR_VREDRAW);
  419.     const int WVR_VALIDRECTS   =       0x0400;
  420.  
  421.  
  422.     /* WM_NCCALCSIZE parameter structure
  423.     typedef struct tagNCCALCSIZE_PARAMS
  424.     {
  425.         RECT       rgrc[3];
  426.         WINDOWPOS FAR* lppos;
  427.     } NCCALCSIZE_PARAMS;
  428.     typedef struct tagNCCALCSIZE_PARAMS
  429.     {
  430.         RECT    rgrc[2];
  431.     } NCCALCSIZE_PARAMS;
  432.     typedef NCCALCSIZE_PARAMS FAR* LPNCCALCSIZE_PARAMS;
  433.     */
  434.  
  435.     const int WM_NCHITTEST     = 0x0084;
  436.  
  437.     // WM_NCHITTEST return codes
  438.     const int HTERROR       = -2;
  439.     const int HTTRANSPARENT = -1;
  440.     const int HTNOWHERE     = 0;
  441.     const int HTCLIENT      = 1;
  442.     const int HTCAPTION     = 2;
  443.     const int HTSYSMENU     = 3;
  444.     const int HTSIZE        = 4;
  445.     const int HTMENU        = 5;
  446.     const int HTHSCROLL     = 6;
  447.     const int HTVSCROLL     = 7;
  448.     const int HTMINBUTTON   = 8;
  449.     const int HTMAXBUTTON   = 9;
  450.     const int HTLEFT        = 10;
  451.     const int HTRIGHT       = 11;
  452.     const int HTTOP         = 12;
  453.     const int HTTOPLEFT     = 13;
  454.     const int HTTOPRIGHT    = 14;
  455.     const int HTBOTTOM      = 15;
  456.     const int HTBOTTOMLEFT  = 16;
  457.     const int HTBOTTOMRIGHT = 17;
  458.     const int HTBORDER      = 18;
  459.     const int HTGROWBOX     = 4; // HTSIZE;
  460.     const int HTREDUCE      = 8; // HTMINBUTTON;
  461.     const int HTZOOM        = 9; // HTMAXBUTTON;
  462.  
  463.     // *******  Drag-and-drop support *******
  464.  
  465.     const int WM_QUERYDRAGICON =    0x0037;
  466.     const int WM_DROPFILES     = 0x0233;
  467.  
  468.     // WM_ACTIVATE state values
  469.     const int WA_INACTIVE      = 0;
  470.     const int WA_ACTIVE       = 1;
  471.     const int WA_CLICKACTIVE   =       2;
  472.  
  473.     const int WM_ACTIVATE      = 0x0006;
  474.     const int WM_ACTIVATEAPP   =       0x001C;
  475.     const int WM_NCACTIVATE    = 0x0086;
  476.  
  477.     const int WM_SETFOCUS      = 0x0007;
  478.     const int WM_KILLFOCUS     = 0x0008;
  479.  
  480.     const int WM_KEYDOWN       = 0x0100;
  481.     const int WM_KEYUP         = 0x0101;
  482.  
  483.     const int WM_CHAR          = 0x0102;
  484.     const int WM_DEADCHAR      = 0x0103;
  485.  
  486.     const int WM_SYSKEYDOWN    = 0x0104;
  487.     const int WM_SYSKEYUP      = 0x0105;
  488.  
  489.     const int WM_SYSCHAR       = 0x0106;
  490.     const int WM_SYSDEADCHAR   = 0x0107;
  491.  
  492.  
  493.     // Keyboard message range
  494.     const int WM_KEYFIRST      = 0x0100;
  495.     const int WM_KEYLAST       = 0x0108;
  496.  
  497.     // WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags
  498.     const long KF_EXTENDED     = 0x0100;
  499.     const long KF_DLGMODE      = 0x0800;
  500.     const long KF_MENUMODE     = 0x1000;
  501.     const long KF_ALTDOWN      = 0x2000;
  502.     const long KF_REPEAT       = 0x4000;
  503.     const long KF_UP           = 0x8000;
  504.  
  505.     // Mouse input messages
  506.     const int WM_MOUSEMOVE     = 0x0200;
  507.     const int WM_LBUTTONDOWN   =       0x0201;
  508.     const int WM_LBUTTONUP     = 0x0202;
  509.     const int WM_LBUTTONDBLCLK =    0x0203;
  510.     const int WM_RBUTTONDOWN   =       0x0204;
  511.     const int WM_RBUTTONUP     = 0x0205;
  512.     const int WM_RBUTTONDBLCLK =    0x0206;
  513.     const int WM_MBUTTONDOWN   =       0x0207;
  514.     const int WM_MBUTTONUP     = 0x0208;
  515.     const int WM_MBUTTONDBLCLK =    0x0209;
  516.  
  517.     // Mouse input message range
  518.     const int WM_MOUSEFIRST    = 0x0200;
  519.     const int WM_MOUSELAST     = 0x0209;
  520.  
  521.     // Mouse message wParam key states
  522.     const int MK_LBUTTON       = 0x0001;
  523.     const int MK_RBUTTON       = 0x0002;
  524.     const int MK_SHIFT         = 0x0004;
  525.     const int MK_CONTROL       = 0x0008;
  526.     const int MK_MBUTTON       = 0x0010;
  527.  
  528.     // Non-client mouse messages
  529.     const int WM_NCMOUSEMOVE      = 0x00A0;
  530.     const int WM_NCLBUTTONDOWN    = 0x00A1;
  531.     const int WM_NCLBUTTONUP      = 0x00A2;
  532.     const int WM_NCLBUTTONDBLCLK  = 0x00A3;
  533.     const int WM_NCRBUTTONDOWN    = 0x00A4;
  534.     const int WM_NCRBUTTONUP      = 0x00A5;
  535.     const int WM_NCRBUTTONDBLCLK  = 0x00A6;
  536.     const int WM_NCMBUTTONDOWN    = 0x00A7;
  537.     const int WM_NCMBUTTONUP      = 0x00A8;
  538.     const int WM_NCMBUTTONDBLCLK  = 0x00A9;
  539.  
  540.     // Mouse click activation support
  541.     const int WM_MOUSEACTIVATE =    0x0021;
  542.  
  543.     // WM_MOUSEACTIVATE return codes
  544.     const int MA_ACTIVATE      = 1;
  545.     const int MA_ACTIVATEANDEAT =   2;
  546.     const int MA_NOACTIVATE    = 3;
  547.     const int MA_NOACTIVATEANDEAT = 4;
  548.  
  549.     // ****** Mode control *********
  550.  
  551.     const int WM_CANCELMODE    = 0x001F;
  552.  
  553.     const int WM_TIMER     = 0x0113;
  554.  
  555.     // Menu messages
  556.     const int WM_INITMENU      = 0x0116;
  557.     const int WM_INITMENUPOPUP =    0x0117;
  558.  
  559.     const int WM_MENUSELECT    = 0x011F;
  560.     const int WM_MENUCHAR      = 0x0120;
  561.  
  562.  
  563.     // Menu and control command messages
  564.     const int WM_COMMAND       = 0x0111;
  565.  
  566.     // ****** Scroll bar support ***
  567.  
  568.     const int WM_HSCROLL       = 0x0114;
  569.     const int WM_VSCROLL       = 0x0115;
  570.  
  571.     // WM_H/VSCROLL commands
  572.     const int SB_LINEUP        = 0;
  573.     const int SB_LINELEFT      = 0;
  574.     const int SB_LINEDOWN      = 1;
  575.     const int SB_LINERIGHT     = 1;
  576.     const int SB_PAGEUP        = 2;
  577.     const int SB_PAGELEFT      = 2;
  578.     const int SB_PAGEDOWN      = 3;
  579.     const int SB_PAGERIGHT     = 3;
  580.     const int SB_THUMBPOSITION = 4;
  581.     const int SB_THUMBTRACK    = 5;
  582.     const int SB_TOP           = 6;
  583.     const int SB_LEFT          = 6;
  584.     const int SB_BOTTOM        = 7;
  585.     const int SB_RIGHT         = 7;
  586.     const int SB_ENDSCROLL     = 8;
  587.  
  588.     // Clipboard command messages
  589.     const int WM_CUT           = 0x0300;
  590.     const int WM_COPY          = 0x0301;
  591.     const int WM_PASTE         = 0x0302;
  592.     const int WM_CLEAR         = 0x0303;
  593.     const int WM_UNDO          = 0x0304;
  594.  
  595.     // Clipboard owner messages
  596.     const int WM_RENDERFORMAT     = 0x0305;
  597.     const int WM_RENDERALLFORMATS = 0x0306;
  598.     const int WM_DESTROYCLIPBOARD = 0x0307;
  599.  
  600.     // Clipboard viewer messages
  601.     const int WM_DRAWCLIPBOARD    = 0x0308;
  602.     const int WM_PAINTCLIPBOARD   = 0x0309;
  603.     const int WM_SIZECLIPBOARD    = 0x030B;
  604.     const int WM_VSCROLLCLIPBOARD = 0x030A;
  605.     const int WM_HSCROLLCLIPBOARD = 0x030E;
  606.     const int WM_ASKCBFORMATNAME  = 0x030C;
  607.     const int WM_CHANGECBCHAIN    = 0x030D;
  608.  
  609.     const int WM_SETCURSOR     = 0x0020;
  610.  
  611.     // ****** WM_SYSCOMMAND support
  612.  
  613.     const int WM_SYSCOMMAND = 0x0112;
  614.  
  615.  
  616.     // System Menu Command Values
  617.     const long SC_SIZE      = 0xF000;
  618.     const long SC_MOVE      = 0xF010;
  619.     const long SC_MINIMIZE  = 0xF020;
  620.     const long SC_MAXIMIZE  = 0xF030;
  621.     const long SC_NEXTWINDOW = 0xF040;
  622.     const long SC_PREVWINDOW = 0xF050;
  623.     const long SC_CLOSE     = 0xF060;
  624.     const long SC_VSCROLL   = 0xF070;
  625.     const long SC_HSCROLL   = 0xF080;
  626.     const long SC_MOUSEMENU = 0xF090;
  627.     const long SC_KEYMENU   = 0xF100;
  628.     const long SC_ARRANGE   = 0xF110;
  629.     const long SC_RESTORE   = 0xF120;
  630.     const long SC_TASKLIST  = 0xF130;
  631.     const long SC_SCREENSAVE = 0xF140;
  632.     const long SC_HOTKEY    = 0xF150;
  633.  
  634.     /* Obsolete names
  635.     const int SC_ICON       = SC_MINIMIZE;
  636.     const int SC_ZOOM       = SC_MAXIMIZE;
  637.     */
  638.  
  639.     // MDI messages
  640.     const int WM_MDICREATE      = 0x0220;
  641.     const int WM_MDIDESTROY     = 0x0221;
  642.     const int WM_MDIACTIVATE    = 0x0222;
  643.     const int WM_MDIRESTORE     = 0x0223;
  644.     const int WM_MDINEXT        = 0x0224;
  645.     const int WM_MDIMAXIMIZE    = 0x0225;
  646.     const int WM_MDITILE        = 0x0226;
  647.     const int WM_MDICASCADE     = 0x0227;
  648.     const int WM_MDIICONARRANGE = 0x0228;
  649.     const int WM_MDIGETACTIVE   = 0x0229;
  650.     const int WM_MDISETMENU     = 0x0230;
  651.  
  652.     /* WM_MDICREATE message structure
  653.     typedef struct tagMDICREATESTRUCT
  654.     {
  655.         LPCSTR  szClass;
  656.         LPCSTR  szTitle;
  657.         HINSTANCE hOwner;
  658.         int     x;
  659.         int     y;
  660.         int     cx;
  661.         int     cy;
  662.         DWORD   style;
  663.         LPARAM  lParam;
  664.     } MDICREATESTRUCT;
  665.     typedef MDICREATESTRUCT FAR*  LPMDICREATESTRUCT;
  666.     */
  667.  
  668.     // wParam values for WM_MDITILE and WM_MDICASCADE messages.
  669.     const int MDITILE_VERTICAL      = 0x0000;
  670.     const int MDITILE_HORIZONTAL    = 0x0001;
  671.     const int MDITILE_SKIPDISABLED  = 0x0002;
  672.  
  673.     const int WM_CHILDACTIVATE =    0x0022;
  674.  
  675.     // Dialog notification messages
  676.     const int WM_INITDIALOG    = 0x0110;
  677.     const int WM_NEXTDLGCTL    = 0x0028;
  678.  
  679.     const int WM_PARENTNOTIFY  =    0x0210;
  680.  
  681.     const int WM_ENTERIDLE     = 0x0121;
  682.  
  683.     const int WM_GETDLGCODE    = 0x0087;
  684.  
  685.     // dialog codes
  686.     const int DLGC_WANTARROWS       = 0x0001;
  687.     const int DLGC_WANTTAB          = 0x0002;
  688.     const int DLGC_WANTALLKEYS      = 0x0004;
  689.     const int DLGC_WANTMESSAGE      = 0x0004;
  690.     const int DLGC_HASSETSEL        = 0x0008;
  691.     const int DLGC_DEFPUSHBUTTON    = 0x0010;
  692.     const int DLGC_UNDEFPUSHBUTTON  = 0x0020;
  693.     const int DLGC_RADIOBUTTON      = 0x0040;
  694.     const int DLGC_WANTCHARS        = 0x0080;
  695.     const int DLGC_STATIC           = 0x0100;
  696.     const int DLGC_BUTTON           = 0x2000;
  697.  
  698.     const int WM_CTLCOLOR      = 0x0019;
  699.  
  700.     // WM_CTLCOLOR control IDs
  701.     const int CTLCOLOR_MSGBOX  =    0;
  702.     const int CTLCOLOR_EDIT    = 1;
  703.     const int CTLCOLOR_LISTBOX =    2;
  704.     const int CTLCOLOR_BTN     = 3;
  705.     const int CTLCOLOR_DLG     = 4;
  706.     const int CTLCOLOR_SCROLLBAR  = 5;
  707.     const int CTLCOLOR_STATIC     = 6;
  708.  
  709.     const int WM_SETFONT       =        0x0030;
  710.     const int WM_GETFONT       = 0x0031;
  711.  
  712.     const int WM_DRAWITEM      =    0x002B;
  713.  
  714.     /*
  715.     typedef struct tagDRAWITEMSTRUCT
  716.     {
  717.         UINT        CtlType;
  718.         UINT        CtlID;
  719.         UINT        itemID;
  720.         UINT        itemAction;
  721.         UINT        itemState;
  722.         HWND    hwndItem;
  723.         HDC     hDC;
  724.         RECT    rcItem;
  725.         DWORD       itemData;
  726.     } DRAWITEMSTRUCT;
  727.     typedef DRAWITEMSTRUCT NEAR* PDRAWITEMSTRUCT;
  728.     typedef DRAWITEMSTRUCT FAR* LPDRAWITEMSTRUCT;
  729.     */
  730.  
  731.     const int WM_MEASUREITEM   =        0x002C;
  732.  
  733.     /*
  734.     typedef struct tagMEASUREITEMSTRUCT
  735.     {
  736.         UINT        CtlType;
  737.         UINT        CtlID;
  738.         UINT        itemID;
  739.         UINT        itemWidth;
  740.         UINT        itemHeight;
  741.         DWORD       itemData;
  742.     } MEASUREITEMSTRUCT;
  743.     typedef MEASUREITEMSTRUCT NEAR* PMEASUREITEMSTRUCT;
  744.     typedef MEASUREITEMSTRUCT FAR* LPMEASUREITEMSTRUCT;
  745.     */
  746.  
  747.     const int WM_DELETEITEM    =    0x002D;
  748.  
  749.     /*
  750.     typedef struct tagDELETEITEMSTRUCT
  751.     {
  752.         UINT       CtlType;
  753.         UINT       CtlID;
  754.         UINT       itemID;
  755.         HWND       hwndItem;
  756.         DWORD      itemData;
  757.     } DELETEITEMSTRUCT;
  758.     typedef DELETEITEMSTRUCT NEAR* PDELETEITEMSTRUCT;
  759.     typedef DELETEITEMSTRUCT FAR* LPDELETEITEMSTRUCT;
  760.     */
  761.  
  762.     const int WM_COMPAREITEM   =       0x0039;
  763.  
  764.     /*
  765.     typedef struct tagCOMPAREITEMSTRUCT
  766.     {
  767.         UINT        CtlType;
  768.         UINT        CtlID;
  769.         HWND    hwndItem;
  770.         UINT        itemID1;
  771.         DWORD       itemData1;
  772.         UINT        itemID2;
  773.         DWORD       itemData2;
  774.     } COMPAREITEMSTRUCT;
  775.     typedef COMPAREITEMSTRUCT NEAR* PCOMPAREITEMSTRUCT;
  776.     typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
  777.     */
  778.  
  779.     // Button Control Messages
  780.     #ifdef WIN32
  781.     #define BM_FIRST 0xF0
  782.     #else
  783.     #define BM_FIRST WM_USER
  784.     #endif
  785.     const int BM_GETCHECK        = BM_FIRST+0x0;
  786.     const int BM_SETCHECK        = BM_FIRST+0x1;
  787.     const int BM_GETSTATE        = BM_FIRST+0x2;
  788.     const int BM_SETSTATE        = BM_FIRST+0x3;
  789.     const int BM_SETSTYLE        = BM_FIRST+0x4;
  790.     #ifdef WIN32                
  791.     const int BM_CLICK            = BM_FIRST+0x5;
  792.     const int BM_GETIMAGE        = BM_FIRST+0x6;
  793.     const int BM_SETIMAGE        = BM_FIRST+0x7;
  794.     #endif
  795.  
  796.     // User Button Notification Codes
  797.     const int BN_CLICKED       = 0;
  798.     const int BN_PAINT         = 1;
  799.     const int BN_HILITE        = 2;
  800.     const int BN_UNHILITE      = 3;
  801.     const int BN_DISABLE       = 4;
  802.     const int BN_DOUBLECLICKED = 5;
  803.  
  804.     // Edit control messages
  805.     #ifdef WIN32
  806.     #define EM_FIRST 0xB0
  807.     #else
  808.     #define EM_FIRST WM_USER
  809.     #endif
  810.     const int EM_GETSEL        = EM_FIRST+0x0;
  811.     const int EM_SETSEL        = EM_FIRST+0x1;
  812.     const int EM_GETRECT       = EM_FIRST+0x2;
  813.     const int EM_SETRECT       = EM_FIRST+0x3;
  814.     const int EM_SETRECTNP     = EM_FIRST+0x4;
  815.     const int EM_LINESCROLL    = EM_FIRST+0x6;
  816.     const int EM_GETMODIFY     = EM_FIRST+0x8;
  817.     const int EM_SETMODIFY     = EM_FIRST+0x9;
  818.     const int EM_GETLINECOUNT  = EM_FIRST+0xA;
  819.     const int EM_LINEINDEX     = EM_FIRST+0xB;
  820.     const int EM_SETHANDLE     = EM_FIRST+0xC;
  821.     const int EM_GETHANDLE     = EM_FIRST+0xD;
  822.     const int EM_GETTHUMB      = EM_FIRST+0xE;
  823.     const int EM_LINELENGTH    = EM_FIRST+0x11;
  824.     const int EM_REPLACESEL    = EM_FIRST+0x12;
  825.     const int EM_SETFONT       = EM_FIRST+0x13;   // NOT IMPLEMENTED: use WM_SETFONT
  826.     const int EM_GETLINE       = EM_FIRST+0x14;
  827.     const int EM_LIMITTEXT     = EM_FIRST+0x15;
  828.     const int EM_SETLIMITTEXT  = EM_FIRST+0x15;   // Win40 Name change
  829.     const int EM_CANUNDO       = EM_FIRST+0x16;
  830.     const int EM_UNDO          = EM_FIRST+0x17;
  831.     const int EM_FMTLINES      = EM_FIRST+0x18;
  832.     const int EM_LINEFROMCHAR  = EM_FIRST+0x19;
  833.     const int EM_SETWORDBREAK  = EM_FIRST+0x1A;   // NOT IMPLEMENTED: use EM_SETWORDBREAK
  834.     const int EM_SETTABSTOPS   = EM_FIRST+0x1B;
  835.     const int EM_SETPASSWORDCHAR     = EM_FIRST+0x1C;
  836.     const int EM_EMPTYUNDOBUFFER     = EM_FIRST+0x1D;
  837.     const int EM_GETFIRSTVISIBLELINE = EM_FIRST+0x1E;
  838.     const int EM_SETREADONLY         = EM_FIRST+0x1F;
  839.     const int EM_SETWORDBREAKPROC    = EM_FIRST+0x20;
  840.     const int EM_GETWORDBREAKPROC    = EM_FIRST+0x21;
  841.     const int EM_GETPASSWORDCHAR     = EM_FIRST+0x22;
  842.     #ifdef WIN32
  843.     const int EM_SETMARGINS          = EM_FIRST+0x23;
  844.     const int EM_GETMARGINS          = EM_FIRST+ 0x24;
  845.     const int EM_GETLIMITTEXT        = EM_FIRST+ 0x25;
  846.     const int EM_POSFROMCHAR         = EM_FIRST+ 0x26;
  847.     const int EM_CHARFROMPOS         = EM_FIRST+ 0x27;
  848.     #endif
  849.  
  850.     // typedef int  (CALLBACK* EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, int cch, int code);
  851.  
  852.     // EDITWORDBREAKPROC code values
  853.     const int WB_LEFT         = 0;
  854.     const int WB_RIGHT        = 1;
  855.     const int WB_ISDELIMITER  = 2;
  856.  
  857.     // Edit control notification codes
  858.     const int EN_SETFOCUS      = 0x0100;
  859.     const int EN_KILLFOCUS     = 0x0200;
  860.     const int EN_CHANGE        = 0x0300;
  861.     const int EN_UPDATE        = 0x0400;
  862.     const int EN_ERRSPACE      = 0x0500;
  863.     const int EN_MAXTEXT       = 0x0501;
  864.     const int EN_HSCROLL       = 0x0601;
  865.     const int EN_VSCROLL       = 0x0602;
  866.  
  867.     // Listbox messages
  868.     #ifdef WIN32
  869.     #define LB_FIRST 0x180
  870.     #else
  871.     #define LB_FIRST WM_USER + 1
  872.     #endif
  873.     const int LB_ADDSTRING        = LB_FIRST+0x0;
  874.     const int LB_INSERTSTRING    = LB_FIRST+0x1;
  875.     const int LB_DELETESTRING    = LB_FIRST+0x2;
  876.     const int LB_SELITEMRANGEEX    = LB_FIRST+0x3;
  877.     const int LB_RESETCONTENT    = LB_FIRST+0x4;
  878.     const int LB_SETSEL            = LB_FIRST+0x5;
  879.     const int LB_SETCURSEL        = LB_FIRST+0x6;
  880.     const int LB_GETSEL            = LB_FIRST+0x7;
  881.     const int LB_GETCURSEL        = LB_FIRST+0x8;
  882.     const int LB_GETTEXT        = LB_FIRST+0x9;
  883.     const int LB_GETTEXTLEN        = LB_FIRST+0xA;
  884.     const int LB_GETCOUNT        = LB_FIRST+0xB;
  885.     const int LB_SELECTSTRING    = LB_FIRST+0xC;
  886.     const int LB_DIR            = LB_FIRST+0xD;
  887.     const int LB_GETTOPINDEX    = LB_FIRST+0xE;
  888.     const int LB_FINDSTRING        = LB_FIRST+0xF;
  889.     const int LB_GETSELCOUNT    = LB_FIRST+0x10;
  890.     const int LB_GETSELITEMS    = LB_FIRST+0x11;
  891.     const int LB_SETTABSTOPS    = LB_FIRST+0x12;
  892.     const int LB_GETHORIZONTALEXTENT = LB_FIRST+0x13;
  893.     const int LB_SETHORIZONTALEXTENT = LB_FIRST+0x14;
  894.     const int LB_SETCOLUMNWIDTH    = LB_FIRST+0x15;
  895.     const int LB_ADDFILE        = LB_FIRST+0x16;
  896.     const int LB_SETTOPINDEX    = LB_FIRST+0x17;
  897.     const int LB_GETITEMRECT    = LB_FIRST+0x18;
  898.     const int LB_GETITEMDATA    = LB_FIRST+0x19;
  899.     const int LB_SETITEMDATA    = LB_FIRST+0x1A;
  900.     const int LB_SELITEMRANGE    = LB_FIRST+0x1B;
  901.     const int LB_SETANCHORINDEX    = LB_FIRST+0x1C;
  902.     const int LB_GETANCHORINDEX    = LB_FIRST+0x1D;
  903.     const int LB_SETCARETINDEX    = LB_FIRST+0x1E;
  904.     const int LB_GETCARETINDEX    = LB_FIRST+0x1F;
  905.     const int LB_SETITEMHEIGHT    = LB_FIRST+0x20;
  906.     const int LB_GETITEMHEIGHT  = LB_FIRST+0x21;
  907.     const int LB_FINDSTRINGEXACT= LB_FIRST+0x22;
  908.     #ifdef WIN32
  909.     const int LB_SETLOCALE      = LB_FIRST+0x25;
  910.     const int LB_GETLOCALE      = LB_FIRST+0x26;
  911.     const int LB_SETCOUNT        = LB_FIRST+0x27;
  912.     const int LB_INITSTORAGE    = LB_FIRST+0x28;
  913.     const int LB_ITEMFROMPOINT    = LB_FIRST+0x29;
  914.     #endif
  915.  
  916.     // Listbox notification codes
  917.     const int LBN_ERRSPACE     = -2;
  918.     const int LBN_SELCHANGE    = 1;
  919.     const int LBN_DBLCLK       = 2;
  920.     const int LBN_SELCANCEL    = 3;
  921.     const int LBN_SETFOCUS     = 4;
  922.     const int LBN_KILLFOCUS    = 5;
  923.  
  924.     // Listbox notification messages
  925.     const int WM_VKEYTOITEM    =    0x002E;
  926.     const int WM_CHARTOITEM    =    0x002F;
  927.  
  928.     // Listbox message return values
  929.     const int LB_OKAY          = 0;
  930.     const int LB_ERR           = -1;
  931.     const int LB_ERRSPACE      = -2;
  932.  
  933.     const long LB_CTLCODE      = 0;
  934.  
  935.     // Combo box messages
  936.     #ifdef WIN32
  937.     #define CB_FIRST 0x140
  938.     #else
  939.     #define CB_FIRST WM_USER
  940.     #endif
  941.     const int CB_GETEDITSEL    = CB_FIRST+0x0;
  942.     const int CB_LIMITTEXT     = CB_FIRST+0x1;
  943.     const int CB_SETEDITSEL    = CB_FIRST+0x2;
  944.     const int CB_ADDSTRING     = CB_FIRST+0x3;
  945.     const int CB_DELETESTRING  = CB_FIRST+0x4;
  946.     const int CB_DIR           = CB_FIRST+0x5;
  947.     const int CB_GETCOUNT      = CB_FIRST+0x6;
  948.     const int CB_GETCURSEL     = CB_FIRST+0x7;
  949.     const int CB_GETLBTEXT     = CB_FIRST+0x8;
  950.     const int CB_GETLBTEXTLEN  = CB_FIRST+0x9;
  951.     const int CB_INSERTSTRING  = CB_FIRST+0xA;
  952.     const int CB_RESETCONTENT  = CB_FIRST+0xB;
  953.     const int CB_FINDSTRING    = CB_FIRST+0xC;
  954.     const int CB_SELECTSTRING  = CB_FIRST+0xD;
  955.     const int CB_SETCURSEL     = CB_FIRST+0xE;
  956.     const int CB_SHOWDROPDOWN  = CB_FIRST+0xF;
  957.     const int CB_GETITEMDATA   = CB_FIRST+0x10;
  958.     const int CB_SETITEMDATA   = CB_FIRST+0x11;
  959.     const int CB_GETDROPPEDCONTROLRECT = CB_FIRST+0x12;
  960.     const int CB_SETITEMHEIGHT = CB_FIRST+0x13;
  961.     const int CB_GETITEMHEIGHT = CB_FIRST+0x14;
  962.     const int CB_SETEXTENDEDUI = CB_FIRST+0x15;
  963.     const int CB_GETEXTENDEDUI = CB_FIRST+0x16;
  964.     const int CB_GETDROPPEDSTATE = CB_FIRST+0x17;
  965.     const int CB_FINDSTRINGEXACT = CB_FIRST+0x18;
  966.  
  967.     #ifdef WIN32
  968.     const int CB_SETLOCALE     = CB_FIRST+0x19;
  969.     const int CB_GETLOCALE     = CB_FIRST+0x1A;
  970.     const int CB_GETTOPINDEX   = CB_FIRST+0x1B;
  971.     const int CB_SETTOPINDEX   = CB_FIRST+0x1C;
  972.     const int CB_GETHORIZONTALEXTENT    = CB_FIRST+0x1D;
  973.     const int CB_SETHORIZONTALEXTENT    = CB_FIRST+0x1E;
  974.     const int CB_GETDROPPEDWIDTH        = CB_FIRST+0x1F;
  975.     const int CB_SETDROPPEDWIDTH        = CB_FIRST+0x20;
  976.     const int CB_INITSTORAGE            = CB_FIRST+0x21;   
  977.     #endif
  978.  
  979.     // Combo box notification codes
  980.     const int CBN_ERRSPACE     = -1;
  981.     const int CBN_SELCHANGE    = 1;
  982.     const int CBN_DBLCLK       = 2;
  983.     const int CBN_SETFOCUS     = 3;
  984.     const int CBN_KILLFOCUS    = 4;
  985.     const int CBN_EDITCHANGE   = 5;
  986.     const int CBN_EDITUPDATE   = 6;
  987.     const int CBN_DROPDOWN     = 7;
  988.     const int CBN_CLOSEUP      = 8;
  989.     const int CBN_SELENDOK     = 9;
  990.     const int CBN_SELENDCANCEL = 10;
  991.  
  992.     // Combo box message return values
  993.     const int CB_OKAY          = 0;
  994.     const int CB_ERR           = -1;
  995.     const int CB_ERRSPACE      = -2;
  996.  
  997.     const int WM_QUEUESYNC     = 0x0023;
  998.  
  999.     const int WM_COMMNOTIFY    = 0x0044;
  1000.  
  1001. }
  1002.